package org.jeecg.modules.school.consult.service.impl;/*
 @author ycz
 @date 2022-01-11-14:41
*/

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.constant.CacheConstant;
import org.jeecg.modules.school.consult.entity.MemSchoolSeekHelp;
import org.jeecg.modules.school.consult.mapper.MemSchoolSeekHelpMapper;
import org.jeecg.modules.school.consult.service.MemSchoolHelpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;

@Service
@Slf4j
public class MemSchoolHelpServiceImpl
        extends ServiceImpl<MemSchoolSeekHelpMapper, MemSchoolSeekHelp> implements MemSchoolHelpService {


    @Autowired
    private MemSchoolSeekHelpMapper seekHelpMapper;



    @Override
    @CacheEvict(value = {CacheConstant.MEM_SEEK_CACHE},allEntries = true)
    @Transactional(rollbackFor = Exception.class)
    public boolean deleteSeekById(String id) {
        this.removeById(id);
        return false;
    }

    @Override
    @CacheEvict(value = {CacheConstant.MEM_SEEK_CACHE},allEntries = true)
    @Transactional(rollbackFor = Exception.class)
    public boolean deleteBatchSeekById(String ids) {
        this.removeByIds(Arrays.asList(ids.split(",")));
        return false;
    }


}
